package com.sky.cost.service.impl;

import java.util.List;
import com.sky.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.sky.cost.mapper.TbProjectCostMapper;
import com.sky.cost.domain.TbProjectCost;
import com.sky.cost.service.ITbProjectCostService;

/**
 * 项目成本明细Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-11-08
 */
@Service
public class TbProjectCostServiceImpl implements ITbProjectCostService 
{
    @Autowired
    private TbProjectCostMapper tbProjectCostMapper;

    /**
     * 查询项目成本明细
     * 
     * @param id 项目成本明细主键
     * @return 项目成本明细
     */
    @Override
    public TbProjectCost selectTbProjectCostById(Long id)
    {
        return tbProjectCostMapper.selectTbProjectCostById(id);
    }

    /**
     * 查询项目成本明细列表
     * 
     * @param tbProjectCost 项目成本明细
     * @return 项目成本明细
     */
    @Override
    public List<TbProjectCost> selectTbProjectCostList(TbProjectCost tbProjectCost)
    {
        return tbProjectCostMapper.selectTbProjectCostList(tbProjectCost);
    }

    /**
     * 新增项目成本明细
     * 
     * @param tbProjectCost 项目成本明细
     * @return 结果
     */
    @Override
    public int insertTbProjectCost(TbProjectCost tbProjectCost)
    {
        tbProjectCost.setCreateTime(DateUtils.getNowDate());
        return tbProjectCostMapper.insertTbProjectCost(tbProjectCost);
    }

    /**
     * 修改项目成本明细
     * 
     * @param tbProjectCost 项目成本明细
     * @return 结果
     */
    @Override
    public int updateTbProjectCost(TbProjectCost tbProjectCost)
    {
        tbProjectCost.setUpdateTime(DateUtils.getNowDate());
        return tbProjectCostMapper.updateTbProjectCost(tbProjectCost);
    }

    /**
     * 批量删除项目成本明细
     * 
     * @param ids 需要删除的项目成本明细主键
     * @return 结果
     */
    @Override
    public int deleteTbProjectCostByIds(Long[] ids)
    {
        return tbProjectCostMapper.deleteTbProjectCostByIds(ids);
    }

    /**
     * 删除项目成本明细信息
     * 
     * @param id 项目成本明细主键
     * @return 结果
     */
    @Override
    public int deleteTbProjectCostById(Long id)
    {
        return tbProjectCostMapper.deleteTbProjectCostById(id);
    }
}
